/*
 * @Author: liuqiang
 * @Date: 2021-02-08 15:22:20
 * @Last Modified by:   liuqiang
 * @Last Modified time: 2021-02-08 15:22:20
 */
var log4js = require('log4js');
log4js.configure({
  appenders: {
    sql: {
      type: 'file',
      filename: './log/sql.log',
      encoding: 'utf-8', //default "utf-8"，文件的编码
      maxLogSize: 1024 * 1024, //文件最大存储空间，当文件内容超过文件存储空间会自动生成一个文件xxx.log.1的序列自增长的文件
      backups: 3,
    },
  },
  categories: { default: { appenders: ['sql'], level: 'debug' } },
});
var logger = log4js.getLogger('sql');

module.exports = { logger };
